package com.study.animal;

import com.study.color.Color;
import org.apache.dubbo.common.URL;

/**
 * @Auther: luobiao
 * @Date: 2020/11/29 17:54
 * @Description:
 */
public class Pig implements Animal {
    private Color color;

    public Pig() {
        System.out.println("Pig 实例初始化...");
    }

    public void sayHello() {
        System.out.println("Hello, I am pig");
    }

    @Override
    public void sayHello(URL url) {
        System.out.println("Hello, I am "+color.printColor(url)+" pig");
    }

    public void setColor(Color color) {
        System.out.println("Pig setColor方法被执行,color="+color);
        this.color = color;
    }
}
